package com.longai.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Momentlike entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "momentlike", catalog = "longai")
public class Momentlike implements java.io.Serializable {

	// Fields

	private Integer momentlikeId;
	private Moment moment;
	private User user;
	private Long momentlikepubtime;

	// Constructors

	/** default constructor */
	public Momentlike() {
	}

	/** full constructor */
	public Momentlike(Moment moment, User user, Long momentlikepubtime) {
		this.moment = moment;
		this.user = user;
		this.momentlikepubtime = momentlikepubtime;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "momentlike_id", unique = true, nullable = false)
	public Integer getMomentlikeId() {
		return this.momentlikeId;
	}

	public void setMomentlikeId(Integer momentlikeId) {
		this.momentlikeId = momentlikeId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "moment_id")
	public Moment getMoment() {
		return this.moment;
	}

	public void setMoment(Moment moment) {
		this.moment = moment;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "momentlikepubtime")
	public Long getMomentlikepubtime() {
		return this.momentlikepubtime;
	}

	public void setMomentlikepubtime(Long momentlikepubtime) {
		this.momentlikepubtime = momentlikepubtime;
	}

}